<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/taglibs.jsp"%>

<form action="${ctx}/sys/orgrule/add" method="post">
    <table>
        <tbody>
            <tr>
                <td><label for="addform-id">组织规则ID</label></td>
                <td><input type="text" id="addform-id" name="id" class="easyui-textbox"
                        data-options="validType:'length[0,32]', prompt:'不输入时会自动生成'"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-parentOrgType">上级组织类型</label></td>
                <td><input type="text" id="addform-parentOrgType" name="parentOrgType" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="addform-childOrgType">下级组织类型</label></td>
                <td><input type="text" id="addform-childOrgType" name="childOrgType" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
        </tbody>
    </table>
</form>

<script type="text/javascript">
$(function(){
    var $parentOrgType = $('#addform-parentOrgType');
    var $childOrgType = $('#addform-childOrgType');
    $parentOrgType.combogrid({
        url: ctx + '/sys/dict/list-by-field',
        queryParams: {
            field: 'org_type'
        },
        idField: 'value',
        textField: 'valueDesc',
        rownumbers: true,
        fitColumns: true,
        columns: [[
            {title: '组织类型', field: 'value', sortable: true, width: 100},
            {title: '类型描述', field: 'valueDesc', sortable: true, width: 100}
        ]]
    });
    $childOrgType.combogrid({
        url: ctx + '/sys/dict/list-by-field',
        queryParams: {
            field: 'org_type'
        },
        idField: 'value',
        textField: 'valueDesc',
        rownumbers: true,
        fitColumns: true,
        columns: [[
           {title: '组织类型', field: 'value', sortable: true, width: 100},
           {title: '类型描述', field: 'valueDesc', sortable: true, width: 100}
        ]]
    });
})
</script>